package com.yunzheng.studyLeaveSystem.modules.user.user_info.service;


import com.yunzheng.studyLeaveSystem.modules.user.user_info.dao.User_infoDao;
import com.yunzheng.studyLeaveSystem.modules.user.user_info.entity.User_info;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: YunZheng
 * @Date: 2023/01/30/19:04
 * @Description:
 */
public class User_infoService {
    private User_infoDao user_infoDao = new User_infoDao();

    public User_info getUser_info(String phone_num) throws Exception {
        return user_infoDao.getUser_info(phone_num);
    }

    public void update(String signature, String phone_num) throws Exception {

    }
    public String updatePassword(String password,String password2,String password3, String phone_num) throws Exception {
        String message = "修改成功";
        if (!(user_infoDao.queryPassword(phone_num).equals(password))) {
            message = "密码错误";
            return message;
        }
        if (!password2.equals(password)) {
            message = "密码不一致！";
            return message;
        }
            user_infoDao.updatePassword(password, phone_num);
        return message;
    }
    }



